{extend name='admin@public/content'}

{block name='content'}
<form onsubmit="return false;" action="" data-auto="true" method="post" class='form-horizontal layui-form' style='padding-top:20px'>
    {if isset($vo['id'])}
    <input type="hidden" name="id" value="{$vo.id}">
    {else}
    <input type="hidden" name="create_at" value="{:date('Y-m-d H:i:s')}">
    {/if}
    <div class="form-group">
        <label class="col-sm-2 control-label">所属栏目：<span class="nowrap"></span></label>
        <div class='col-sm-8'>
            <select name="pid" id="">
                {foreach $cate as $v}
                <option {if isset($vo['id']) && $vo.id==$v.id}selected{/if} value="{$v.id}">{$v.title}</option>
                {/foreach}
            </select>
            <p class="help-block"></p>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">头像：<span class="nowrap"></span></label>
        <div class='col-sm-8'>
            <img data-tips-image style="height:auto;max-height:120px;max-width:120px" src="{$vo.thumb ?: '__STATIC__/theme/img/image.png'}"/>
            <input type="hidden" name="thumb" onchange="$(this).prev('img').attr('src', this.value)" value="{$vo.thumb ?: ''}" class="layui-input">
            <a class="btn btn-link" data-file="one" data-uptype="" data-width="" data-height="" data-type="png,jpg,jpeg" data-field="thumb">上传图片</a>
            <p class="help-block"></p>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">专家名称：<span class="nowrap"></span></label>
        <div class='col-sm-8'>
            <input type="text" name="name" title="请输入专家名称" required placeholder="请输入专家名称" value="{$vo.name ?: ''}" class="layui-input">
            <p class="help-block"></p>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">身份简介：<span class="nowrap"></span></label>
        <div class='col-sm-8'>
            <textarea name="desc" title="请输入身份简介" required placeholder="请输入身份简介" class="layui-textarea" rows="1">{$vo.desc ?: ''}</textarea>
            <p class="help-block"></p>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">详细描述：<span class="nowrap"></span></label>
        <div class='col-sm-8'>
            <textarea name="content" required placeholder="请输入" class="layui-textarea">{$vo.content ?: ''}</textarea>
            <p class="help-block"></p>
        </div>
    </div>

    <div class="hr-line-dashed"></div>

    <div class="col-sm-8 col-sm-offset-2">
        <div class="layui-form-item text-left">
            <button class="layui-btn" type="submit">保存</button>
        </div>
    </div>
</form>

{/block}
{block name="script"}
<script>
    window.form.render();
    //富文本
    require(['ckeditor'],function () {
        window.createEditor('[name="content"]', {height: 400});
    })
</script>
{/block}